<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ include file="/WEB-INF/views/admin/app_base.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="format-detection" content="telephone=no" />
    <meta content="email=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <%@ include file="/WEB-INF/views/admin/app_js_css.jsp"%>
    <link rel="stylesheet" href="<%=basePath%>/static/admin/app/css/divselect.css">
    <!--引入 lrz 插件 用于压缩图片-->
    <script type="text/javascript" src="<%=basePath%>/static/admin/app/js/localResizeIMG/lrz.bundle.js"></script>
    <script rel="script" src="<%=basePath%>/static/admin/app/js/fileUpload.js"></script>
    <script rel="script" src="<%=basePath%>/static/admin/app/js/customer_update.js"></script>
    <title>客户管理</title>
</head>
<body>
<div class="viewport">
<header>
	<div class="header-title">
        <a href="<%=basePath%>/admin/customer" class="return"><i class="iconfont"></i>返回</a>
        <h2>${customerTitle }</h2>
    </div>
</header>   
<section>
<form id="userInfoForm" role="form">
    <div class="form-box">
    	<div class="form-group">
            <label><em class="red">*</em>客户名称</label>
            <input id="customerId" type="hidden" value="${customer.id }">
            <input id="customerName" type="text" class="form-control"  placeholder="请填写客户姓名" value="${customer.customerName }">
        </div>
        <div class="form-group">
            <label><em class="red">*</em>联系人名称</label>
            <input id="linkName" type="text" class="form-control"  placeholder="请填写客户姓名" value="${customer.linkName }">
        </div>
        <div class="form-group">
            <label><em class="red">*</em>手机号</label>
            <input id="mobile" type="text" class="form-control"  placeholder="请填写客户手机号" value="${customer.mobile }">
        </div>
        <c:if test="${empty customer.customerName }">
        <div class="form-group">
        	<label><em class="red">*</em>密码</label>
        	<input id="password" type="password" class="form-control"  placeholder="请输入密码">
	    </div>
	    <div class="form-group">
        	<label><em class="red">*</em>确认密码</label>
	        <input id="repassword" type="password" class="form-control"  placeholder="请再次输入密码">
	    </div>
        </c:if>
	    <div class="form-group">
            <label><em class="red">*</em>客户类型</label>
            <div class="row" >
	            <div class="col-xs-4">
					<input type="radio" name="customerType" value="0" <c:if test="${customer.type == 0}">checked</c:if>>企业
	            </div>
	            <div class="col-xs-4">
	            	<input type="radio" name="customerType" value="1" <c:if test="${customer.type == 1}">checked</c:if>>个人
	            </div>
	            <div class="col-xs-4">
	            	<input type="radio" name="customerType" value="-1" <c:if test="${customer.type == -1}">checked</c:if>>保密
	            </div>
            </div>
        </div>
        <div class="form-group">
            <label><em class="red">*</em>客户等级<em class="red">(只能输入数字0~10)</em></label>
            <div class="row" >
	            <div class="col-xs-10">
					<input id="customerLevel" type="text" class="form-control"  placeholder="请填写客户等级" value="${customer.customerLevel }">
	            </div>
	            <div class="col-xs-2">
	            	级
	            </div>
            </div>
        </div>
        <div class="form-group">
            <label><em class="red">*</em>客户折扣率<em class="red">(只能输入数字:0~100)</em></label>
            <div class="row" >
	            <div class="col-xs-10">
					<input id="customerDiscount" type="text" class="form-control"  placeholder="请填写客户折扣率" value="${customer.customerDiscount }">
	            </div>
	            <div class="col-xs-2">
	            	%
	            </div>
            </div>
        </div>
        <div class="form-group">
            <label><em class="red">*</em>微信号</label>
            <input id="weixin" type="text" class="form-control"  placeholder="请输入客户微信号" value="${customer.weixin }">
        </div>
        <div class="form-group">
            <label><em class="red"></em>微信二维码</label>
            <a class="upload-file-btn">
                <i class="iconfont"></i>
                <img id="weixinQrCodeImage" src="${customer.weixinQrCode }" width="98" height="100"/>
                <input id="weixinQrCode" type="file" class="upload_file" onchange="ajaxFileUpload('/${user.loginName }/upload/weixinQrCode','weixinQrCode','weixinQrCodeImage')"/>
            </a>
        </div>
        <div class="form-group">
            <label><em class="red">*</em>所属业务员</label>
            <div class="row" >
	            <div class="col-xs-10">
	            	<input id="customerBusinessId" type="hidden" value="${customer.businessId }">
					<input id="customerBusinessName" type="text" readonly class="form-control"  placeholder="请选择所属业务员" value="${customer.businessName }">
	            </div>
	            <div class="col-xs-2">
	            	<a id="clearBusinessBnt" class="new-tbl-cell btn btn-warning">清空</a>
	            </div>
            </div>
        </div>
        <div class="form-group">
        	<label>邮箱</label>
	        <input id="email" type="text" class="form-control"  placeholder="请输入邮箱以便接收系统消息" value="${customer.email }">
	    </div>
        <div class="form-group">
            <label>QQ账号</label>
            <input id="qq" type="text" class="form-control"  placeholder="请输入QQ账号" value="${customer.qq }">
        </div>
        <div class="form-group">
            <label>性别</label>
            <select id="sex" class="form-control">
                <option value = "1" <c:if test="${customer.sex == 1}">selected="selected"</c:if>>男</option>
                <option value = "0" <c:if test="${customer.sex == 0}">selected="selected"</c:if>>女</option>
                <option value = "-1" <c:if test="${customer.sex == -1}">selected="selected"</c:if>>保密</option>
            </select>
        </div>
        <div class="form-group">
            <label>身份证号</label>
            <input id="idCard" type="text" class="form-control"  placeholder="请输入客户身份证号" value="${customer.idCard }">
        </div>
        <div class="form-group">
            <label>客户地址</label>
            <textarea id="address" class="form-control" rows="5" placeholder="请详细填写客户地址">${customer.address }</textarea>
        </div>
    </div>
</form>
<div style="height: 60px"></div>
<div class="new-brn-tab new-brn-border">
    <div class="new-tbl-type">
        <a id="saveCustomerBtn" class="new-tbl-pwd btn btn-primary">提交</a>
        <a href="<%=basePath%>/admin/customer" class="new-tbl-pwd btn btn-cancel">取消</a>
    </div>
</div>
</section>
</div>
<div id="employeeListDiv" class="select-div-view">
	<header>
	    <div class="header-title">
	    	<a id="hiddenListBtn" class="return"><i class="iconfont"></i>返回</a>
	        <h2>请单击选择业务员</h2>
	    </div>
	</header>
	<article>
	    <div class="date-tab-type">
	        <ul class="date-tab-cell">
	            <li>员工姓名</li>
	            <li>员工电话</li>
	            <li>员工微信</li>
	            <li>员工类型</li>
	        </ul>
	    </div>
	    <div id="detailBoxDiv" class="details-box">
	    	<c:forEach var="employee" items="${employeeList}">
	    	<a onclick="selectMyChoice('${employee.id }','${employee.name }')" class="details-link">
		        <ul class="details-list">
		            <li>${employee.name }</li>
		            <li>${employee.loginName }</li>
		            <li>${employee.weixin }</li>
		            <li>
		            	<c:if test="${employee.type == 2 }">经理</c:if>
	                	<c:if test="${employee.type == 3 }">业务员</c:if>
	               	</li>
		        </ul>
	    	</a>
	    	</c:forEach>
	    </div>
	</article>
</div>
</body>
</html>